Package eu.europa.ec.taxud.cesop.readers
Class CesopXmlReader
java.lang.Object
eu.europa.ec.taxud.cesop.readers.CesopXmlReader
- All Implemented Interfaces:
AutoCloseable
Utils class reading an XML file.
-
Constructor Summary
ConstructorsConstructorDescriptionCesopXmlReader(InputStream inputStream) CesopXmlReader(InputStream inputStream, org.codehaus.stax2.validation.XMLValidationSchema xsd) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the current start tag name.Returns the XML stream reader wrapper.booleanPositions the cursor on the next XML start element..booleanPositions the cursor on the next XML start element with specified QName.readNextTagIfEquals(QName qName) readNextTagIntoMap(QName qName) Read the next tag QName and return a map with all the children values.
-
Constructor Details
-
CesopXmlReader
- Throws:
XMLStreamException
-
CesopXmlReader
public CesopXmlReader(InputStream inputStream, org.codehaus.stax2.validation.XMLValidationSchema xsd) throws XMLStreamException Constructor.- Parameters:
inputStream- the input stream. The input stream is not closed byCesopXmlReader.xsd- the xsd- Throws:
XMLStreamException- in case of error while processing the XML content
-
-
Method Details
-
getStartElementName
Returns the current start tag name.- Returns:
- the tag name
- Throws:
XMLStreamException- if the current event type is not a start element
-
positionCursorOnStartElement
Positions the cursor on the next XML start element.. The next call toXmlStreamReaderWrapper.moveToNextElement()will return the start element.- Returns:
- true if the start element is found, false otherwise
- Throws:
XMLStreamException- in case of error while processing the XML content
-
positionCursorOnStartElement
Positions the cursor on the next XML start element with specified QName. The next call toXmlStreamReaderWrapper.moveToNextElement()will return the start element.- Parameters:
qName- the name of the start element to search for- Returns:
- true if the start element is found, false otherwise
- Throws:
XMLStreamException- in case of error while processing the XML content
-
readNextTagIfEquals
If the next start element is qName, then returns anOptionalcontainingMapwith all the children values. Otherwise, returns an emptyOptional.- Parameters:
qName- the tag- Returns:
- the map of values
- Throws:
XMLStreamException- in case of error while processing the XML content
-
readNextTagIntoMap
Read the next tag QName and return a map with all the children values.- Parameters:
qName- the tag- Returns:
- the map of values
- Throws:
XMLStreamException- in case of error while processing the XML content
-
getXmlStreamReaderWrapper
Returns the XML stream reader wrapper.- Returns:
- the XML stream reader wrapper
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
XMLStreamException
-